package com.ilibrary.web.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.ilibrary.base.MyBaseVO;

/**
 * 结果传输对象
 * 
 * @author ZhongJiang
 *
 */
public class ResultDto<T extends MyBaseVO> implements Serializable {
	boolean success;
	String msg;
	private List<T> voList = new ArrayList<T>();
	private T firstResult;
	private Integer total;
	
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	
	public List<T> getResultList() {
		return voList;
	}
	
	public T getFirstResult() {
		return firstResult;
	}
	
	public void addToResultList(T vo) {
		this.voList.add(vo);
		if(this.firstResult == null) {
			this.firstResult = vo;
		}
	}
	public Integer getTotal() {
		return total;
	}
	public void setTotal(Integer total) {
		this.total = total;
	}
	
}
